package com.superpeer.baseproject.api;

import com.superpeer.baseproject.bean.BaseBeanResult;
import com.superpeer.baseproject.bean.BaseObject;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;


public interface ApiService {

    //获取文章
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @GET("app/shop/querySchoolInfo")
    Observable<BaseBeanResult> getNews(@Query("defaultCurrent") int defaultCurrent, @Query("pageSize") int pageSize);

    //支付
    @FormUrlEncoded
    @POST("/app/order/push")
    Observable<BaseBeanResult> pay(@Field("code") String code,@Field("price") String price);

    //上传商品 传json
    @POST("app/shop/saveGoodsFromLocalNew")
    Observable<BaseBeanResult> localUpload(@Body BaseObject goodsBean);

    //保存申请入驻 传对象
    @Multipart
    @POST("app/shop/saveShopInfo")
    Observable<BaseBeanResult> saveShopInfo(@Part("shopId") RequestBody shopId, @Part("accountId") RequestBody accountId, @Part("name") RequestBody name,
                                            @Part("imagePath") RequestBody imgHeadUrl, @Part("type") RequestBody type, @Part("typeName") RequestBody typeName,
                                            @Part("businessScope") RequestBody businessScope,
                                            @Part("areaCode") RequestBody areaCode, @Part("longitude") RequestBody longitude, @Part("latitude") RequestBody latitude,
                                            @Part("address") RequestBody address, @Part("bossName") RequestBody bossName, @Part("phone") RequestBody phone, @Part("detailedAddress") RequestBody detailed, @Part("openingTime") RequestBody openingTime,
                                            @Part("closingTime") RequestBody closingTime);
}
